package com.wu.client.controller;

import com.wu.client.cache.ConstantData.*;
import com.wu.client.vo.res.ConstantResp;
import com.wu.client.vo.res.playlist.PlaylistCategoriesResp;
import com.wu.common.convertion.result.Result;
import com.wu.common.convertion.result.Results;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @author Cousin
 * @date 2025/3/24
 * @Description
 */
@RestController
public class ConstantController {
    @GetMapping("regions-languages")
    public Result<Map<String, List<ConstantResp>>> getRegionAndChannel(){
        return Results.success(RegionAndLanguageCache.getInstance().getMap());
    }
    @GetMapping("/artists/types")
    public Result<Map<String, List<ConstantResp>>> getArtistGenre(){
        return Results.success(ArtistTypeCache.getInstance().getMap());
    }
    @GetMapping("/albums/genres")
    public Result<Map<String, List<ConstantResp>>> getAlbumGenre(){
        return Results.success(AlbumGenresCache.getInstance().getMap());
    }
    @GetMapping("/mvs/types")
    public Result<Map<String, List<ConstantResp>>> getMvTypes(){
        return Results.success(MvTypesCache.getInstance().getMap());
    }
    @GetMapping("/playlists/categories")
    public Result<PlaylistCategoriesResp> getPlaylistCategories(){
        return Results.success(PlaylistGenresCache.getInstance().getPlaylistCategoriesResp());
    }
}
